home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: SIN?
- Date: 8 Apr 1996 13:44:03 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4kbtqjINNpvs@keats.ugrad.cs.ubc.ca>
- References: <90.50656.1119@svis.org>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <90.50656.1119@svis.org>,
- Cory Pollock <cory.pollock@svis.org> wrote:
- >Hello All,
- >
- >Can someone please wirte a little program to show me what the function
- >SIN((FLOAT)X) does?
-
- Conceptually, it constructs a circle of radius 1 centered on the origin of a
- cartesian coordinate system. It then draws a ray from the origin to the circle
- that is rotated X radians counterclockwise from the x axis. Then it measures
- the y coordinate of the point of intersection between the ray and the circle,
- and returns this value as a result.
-
- The precision depends on having a high-resolution frame buffer with enough
- bit-depth to render the graphics with good anti-aliasing.
-
- The sin() function in <math.h> does essentially the same thing but it takes
- advantage of mathematical theorems to effectuate a tremendous speedup.
- --
-
-